<?php

/**
 * 上传文件接口
 * @author maniac
 */

namespace app\shop\controller;


use app\facade\Upload AS UploadFacade;

class Upload extends Base

{

    /**
     * 上传文件接口
     */

    public function upload()

    {

        $data = input('param.');

        $data['path'] = isset($data['path']) && $data['path'] ? $data['path'] : 0;

        $result = UploadFacade::upload($data);

        if ($result) {

            return j(0, '上传成功', $result);

        }

        return j(1, '上传失败');

    }
    /**

     * 附件管理

     */

    public function filemanager()

    {

        $data = input('param.');

        $result = UploadFacade::filemanager($data);
        if ($result) {
            return j(0, '获取附件成功', $result);
        }
        return j(1, '获取附件失败');


    }

}

